Method of interfacing a lc sensor and related system

ABSTRACT

A method of interfacing a LC sensor with a control unit is provided. The control unit may include first and second contacts, where the LC sensor is connected between the first and the second contact. A capacitor is connected between the first contact and a ground. To start the oscillation of the LC sensor, the method may include during a first phase, connecting the first contact to a supply voltage and placing the second contact in a high impedance state such that the capacitor is charged through the supply voltage. During a second phase, the first contact may be placed in a high impedance state, and the second contact connected to the ground such that the capacitor transfers charge towards the LC sensor. During a third phase, the first contact and the second contact may be placed in a high impedance state so the LC sensor is able to oscillate.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional of U.S. patent application Ser. No.14/739,195, filed on Jun. 15, 2015, which application claims the benefitof Italian Patent Application No. TO2014A000549, filed Jul. 9, 2014,which applications are hereby incorporated herein by reference.

TECHNICAL FIELD

Embodiments of the present disclosure relate to techniques forinterfacing an LC sensor.

BACKGROUND

LC sensors are well known in the art. For example, LC sensors may beused as electronic proximity sensors which are able to detect thepresence of a conductive target. Some common applications of inductivesensors include, e.g., metal detectors and derived applications, such asrotation sensors.

FIG. 1 shows the basic behavior of an LC sensor 10. Specifically, in theexample considered, the LC sensor 10 includes an inductor L and acapacitor C, which form a resonant circuit also called tank circuit. Thearrangement further includes a power supply 102, such as a voltagesource, and a switch 104.

When the switch 104 is in a first position (as shown in FIG. 1), thecapacitor C is charged up to the supply voltage. When the capacitor C isfully charged, the switch 102 changes position, placing the capacitor102 in parallel with the inductor L, and it starts to discharge throughthe inductor L. This starts an oscillation between the LC resonantcircuit 10.

From a practical point of view, the LC sensor 10 also includes aresistive component R, which will dissipate energy over time.Accordingly, losses occur which will decay the oscillations, i.e., theoscillation is dampened.

Such an LC sensor 10 may be used, e.g., to detect metallic objects. Thisis because the oscillation will be damped quicker in the presence of ametallic object (see, e.g., FIG. 2b ) compared to an oscillation withouta metallic object (see, e.g., FIG. 2a ). Generally speaking, the sensingcomponent of an LC sensor 10 may be the inductor L, the capacitor Cand/or the resistor R. For example, the resistance R primarilyinfluences the damping factor, while the L and C component primarilyinfluence the oscillation frequency.

Moreover, such a LC sensor 10 may also be created by simply connecting acapacitor C to an inductive sensor L, or an inductor L to a capacitivesensor C. However, the inductor L (with its dissipative losses) usuallyprovides the sensing element.

FIG. 3a shows a possible embodiment for performing the LC sensing of thesensor 10 with a control unit 20, such as a microcontroller, asdescribed, e.g., in the documents Application Note AN0029, “Low EnergySensor Interface—Inductive Sensing”, Rev. 1.05, 2013-05-09, Energymicro, or Application Report SLAA222A, “Rotation Detection with theMSP430 Scan Interface”, April 2011, Texas Instruments. In the exampleconsidered, the control unit 20 has two pins or pads 202 and 204, andthe LC sensor 10 is connected between these pins 202 and 204.

The control unit 20 includes a controllable voltage source 206 connectedto the pin 202 to impose a fixed voltage V_(MID) at this pin 202. Forexample, a digital-to-analog converter (DAC) is typically used for thispurpose.

During a charge phase, the pin 204 is connected to ground GND.Accordingly, during this phase, the sensor 10 is connected between thevoltage V_(MID) and ground GND, and the capacitor C of the sensor 10 ischarged to the voltage V_(MID).

Next, the control unit 20 opens the second pin 204, i.e., the pin 204 isfloating. Accordingly, due to the fact that the capacitor C of thesensor 10 has be charged during the previous phase, the LC resonantcircuit 10 starts to oscillate as described above.

Thus, by analyzing the voltage, e.g., voltage V204 at pin 204, theoscillation may be characterized. In fact, as shown in FIG. 3b , thevoltage at the pin 204 corresponds to a damped oscillation having a DCoffset corresponding to the voltage V_(MID), imposed by the voltagesource 206, i.e., the voltage V_(MID) defines the middle point of theoscillation. Accordingly, the voltage V_(MID) is usually set to half ofthe supply voltage of the control unit 20, e.g., VDD/2, in order to havethe maximum range.

Often, the circuit also includes an additional capacitor C1 connectedbetween the pin 202 and ground GND to stabilize the voltage signalV_(MID) and to provide the boost of current required to charge thesensor. In order to analyze the signal at the pin 204 (see, e.g., FIG.3a ), the control unit 20 may include an analog-to-digital converter(ADC) 208 connected to the pin 204 to sample the voltage of theoscillation. Thus, based on the resolution and sampling frequency of theADC 206, the whole oscillation may be characterized.

FIG. 4 shows an alternative approach. More specifically, in theillustrated example, the control unit 20 comprises a comparator 210which compares the voltage at the pin 204 with a reference signal, suchas a reference voltage V_(Ref). For example, this reference voltageV_(Ref) may be fixed, e.g., to VDD/2, or set via a digital-to-analogconverter 212. For example, FIGS. 5a and 5b respectively show theoscillations with and without a metallic object in the vicinity of thesensor 10, along with a possible reference voltage V_(Ref) and theoutput CMP of the comparator 210. Generally, the two approaches shown inFIGS. 3a and 4, i.e., the ADC 208 and comparator 210, may also becombined in the same control unit 20.

Thus, based on the foregoing, contactless motion measurement may beachieved by interfacing LC sensors directly with microcontrollerintegrated circuits (ICs). Such sensing may be useful, e.g., formetering systems (gas, water, distance, etc.). However, while handlingand sampling sensors, microcontrollers (or MCUs) should reduce as muchas possible the power consumption to permit the development ofbattery-powered systems. Moreover, as MCU units are typicallygeneral-purpose, there is also the need to reduce as much as possiblethe silicon area due to the specialized circuits required for theimplementation of the above functionality.

Accordingly, in LC sensor excitation and measurement techniques it isimportant to reduce consumption and cost, especially for battery poweredapplications as already mentioned. Thus, a first problem is related tothe use of dedicated low power analog components, e.g., for generatingthe voltage V_(MID) and the internal reference voltage V_(Ref), whichresults in a greater cost.

A second problem is related to the digital-to-analog converter 212 thatshould be both low power and fast enough to follow the dumpedoscillation. This leads to significant power consumption permeasurement, and challenging application constraints in battery-poweredsystems.

Furthermore, Process-Voltage-Temperature (PVT) variations are anotherimportant issue in battery-powered systems, where there are significantvoltage changes. Indeed, most of the components described in theforegoing could be affected by the PVT variations, including: sensors(damping factor, frequency, etc.); I/O pads current and resistance(excitation); comparators switching point, etc.

SUMMARY

Based upon the foregoing, there is a need for approaches which overcomeone or more of previously outlined drawbacks.

Such an object is achieved through a method having the featuresspecifically set forth in the claims that follow. A related system isprovided, as well as a corresponding related computer program product,loadable in the memory of at least one computer and including softwarecode portions for performing the steps of the method of the inventionwhen the product is run on a computer. As used herein, reference to sucha computer program product is intended to be equivalent to reference toa computer-readable medium containing computer-readable instructions forcontrolling a computer system to coordinate the performance of themethod of the invention. Reference to “at least one computer” isintended to highlight the possibility for the present invention to beimplemented in a distributed/modular fashion. The claims are an integralpart of the disclosure of the invention provided herein. The claims arean integral part of the technical teaching of the invention providedherein.

As mentioned above, the present description provides approaches forinterfacing a LC sensor with a control unit, such as a microcontroller,where the control unit comprises a first and a second contact, such asthe pins or pads of a microcontroller. In particular, the LC sensor isconnected between two contacts and an additional capacitor is connectedbetween the first contact and a ground.

In some embodiments, the oscillation of the LC sensor is started bythree phases. More specifically, during the first phase, the firstcontact is connected to a supply voltage and the second contact isplaced in a high impedance state, e.g., disconnected, such that thecapacitor is charged through the supply voltage provided at the firstcontact. During the second phase, the first contact is placed in a highimpedance state, e.g., disconnected, and the second contact is connectedto ground, whereby the capacitor is connected in parallel with the LCsensor and charge is transferred from the capacitor towards the LCsensor. During the third phase, both contacts are placed in a highimpedance state, such that the LC sensor is able to oscillate.Accordingly, the oscillation of the LC sensor may be started with athree state driver circuitry, e.g., of a microcontroller.

In some embodiments, the duration of the second phase, i.e., the chargetransfer phase, is varied to regulate the voltage at the capacitor atthe beginning of the third phase (i.e., the oscillation phase). Thisdefines the middle point voltage of the oscillation occurring at thesecond contact.

In some embodiments, the voltage at the second contact is monitored atleast during the third phase to determine some characteristics of theoscillation of the LC sensor. For example, the voltage at the secondcontact may be compared with at least one reference voltage in order togenerate a comparison signal. In this case, the number of pulses in thecomparison signal may be counted to characterize the oscillation.Accordingly, the oscillation of the LC sensor may be monitored with aninput sensing circuitry, e.g., of a microcontroller.

In some embodiments, the number of pulse is also used to regulate themiddle point voltage of the oscillation occurring at the second contact.For example, this may be done by varying the duration of the secondphase, i.e., the charge transfer phase.

In some embodiments, the charge or discharge behavior of the capacitormay be analyzed via a comparator with hysteresis during a calibrationphase. The middle point voltage of the oscillation occurring at thesecond contact may be regulated by recharging or discharging thecapacitor between the second and third phase based on the charge ordischarge behavior of the capacitor determined during the calibrationphase. Accordingly, the middle point voltage of the oscillation may alsobe regulated with the three state driver circuitry, e.g., of amicrocontroller.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the present disclosure will now be described withreference to the annexed drawings, which are provided by way ofnon-limiting example, and in which:

FIG. 1 is a schematic diagram of an LC sensor in accordance with theprior art;

FIGS. 2a and 2b are graphs of voltage oscillation of the LC sensor ofFIG. 1 with and without a metallic object present, respectively;

FIG. 3a is a schematic diagram illustrating another LC sensorarrangement including a controller in accordance with the prior art, andFIG. 3b is a graph of voltage oscillation of the LC sensor of FIG. 3 a;

FIG. 4 is a schematic diagram of another LC sensor arrangement includinga controller in accordance with the prior art;

FIGS. 5a and 5b are graphs of voltage oscillation of the LC sensorarrangement of FIG. 4 with and without a metallic object present,respectively;

FIGS. 6, 7, 9, 10 and 12 are schematic diagrams illustrating systems forinterfacing an LC sensor in accordance with example embodiments;

FIGS. 8, 14, and 15 are flow diagrams illustrating methods forinterfacing an LC sensor which may be used in the systems of FIGS. 6, 7,9, 10 and 12;

FIGS. 11a-11d and 16 are graphs illustrating exemplary waveforms whichmay occur in the systems of FIGS. 6, 7, 9, 10 and 12; and

FIG. 13 is a table providing exemplary results obtained with the systemsof FIGS. 6, 7, 9, 10 and 12.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

In the following description, various specific details are given toprovide a thorough understanding of embodiments. The embodiments may bepracticed without one or several specific details, or with othermethods, components, materials, etc. In other instances, well-knownstructures, materials, or operations are not shown or described indetail to avoid obscuring aspects of the embodiments.

Reference throughout this specification to “one embodiment” or “anembodiment” means that a particular feature, structure, orcharacteristic described in connection with the embodiment is includedin at least one embodiment. Thus, the appearances of the phrases “in oneembodiment” or “in an embodiment” in various places throughout thisspecification are not necessarily all referring to the same embodiment.Furthermore, the particular features, structures, or characteristics maybe combined in any suitable manner in one or more embodiments. Theheadings provided herein are for convenience only and do not interpretthe scope or meaning of the embodiments.

In the following FIGS. 6 to 16, parts, elements or components which havealready been described with reference to FIGS. 1 to 5 are denoted by thesame references previously used in such figures. As such, thedescription of such previously described elements will not be repeatedin the following description.

The embodiments described herein provide approaches that permit anefficient handling of at least one LC sensor 10 by reducing the requireddedicated on-chip components and/or by providing reduced powerconsumption. Some embodiments may also be implemented in a full digitalmanner with a conventional low cost microcontroller, thus reducing cost.

Various embodiments may provide an improved resilience against PVTvariations (particularly suitable for battery powered systems). In someembodiments, the approach is based on two different techniques, namelyCapacitive Dynamic Charge Sharing (CDCS) and Self-Tuning Reference(STR). In some embodiments, such an approach applies a capacitivedynamic charge sharing to remove the V_(MID) generator and the V_(Ref)Generator 206/212 shown with respect to FIGS. 3a and 4, and to use aSelf-Tuning Reference technique to permit the use of a fixed internalreference and to improve robustness against PVT variations.

Capacitive Dynamic Charge Sharing

As mentioned above, the Capacitive Dynamic Charge Sharing (CDCS)technique allows for the removal of the V_(MID) voltage generatormodule. More particularly, this approach is based on the fact that, in avery short time, the inductance L of the sensor 10 is such that thecapacitor C1 and the capacitor C of the sensor 10 are connected inseries.

FIG. 6 shows the basic architecture of this approach. More specifically,in the illustrated embodiment the LC sensor 10 is connected again (e.g.,directly) between the pins 202 and 204 of the control unit 20, such as amicrocontroller. Moreover, a capacitor C1 is connected (e.g., directly)between the pin 202 and ground GND. As will be described further below,the capacitor C1 is used in a different manner as compared to the priorart approaches described with respect to FIGS. 3b and 4.

In the illustrated embodiment, the control unit 20 does not include adedicated DAC for generating the voltage V_(MID), but the control unit20 merely includes a switch 220 configured to selectively connect thepin 202 to a fixed voltage, such as the supply voltage VDD of thecontrol unit 20 or a voltage signal provided by an internal voltagereference generator, which is often available in conventionalmicrocontrollers. Generally speaking, the supply voltage VDD may bereceived via a power supply pin of the control unit 20 (not shown).Accordingly, the pin 202 may be either floating or connected to a supplyvoltage. For example, in some embodiments the operation of the switch202 may be implemented with a convention three state driver circuitry,e.g., “1” for VDD, “o” for GND and “Z” for a high impedance state, whichis often used for output pins of microcontrollers or other digitalintegrated circuits.

In the present embodiment, the control unit 20 includes a further switch222 configured to connect the pin 204 selectively to ground GND. Thus,the operation of the switch 222 may be implemented also with theconventional driver circuitry of an output pin of a microcontroller.

The switching of the switches 220 and 222 is controlled by a processingunit 230, such as a digital processing unit programmed via softwareinstructions. For example, this may be the central processing unit (CPU)of a microcontroller or a dedicated digital IP. Accordingly, in someembodiments (see, e.g., FIG. 7), the above-described driving of the pads202 and 204 may be implemented with conventional three state drivingcircuits 240 and 242, e.g., of a microcontroller 20.

FIG. 8 shows a flow chart of the main operations performed by thecontrol unit 20 to start an oscillation of the LC sensor 10. After astart step 2000, the control unit 20 connects in a step 2002 the pin 202to a supply signal, such as the supply voltage VDD of themicrocontroller 20, and the pin 204 is floating. For example, theprocessing unit 230 may drive the pin 202 with the logic level “1” andthe pin 204 with the logic level “Z”. Accordingly, in the step 2002,only the capacitor C1 is connected between the supply voltage VDD andground GND, and the capacitor C1 is charged.

Next, the control unit 20 connects the pin 204 to ground GND in a step2004, while the pin 202 is floating. For example, the processing unit230 may drive the pin 202 with the logic level “Z” and the pin 204 withthe logic level “o”. Accordingly, in the step 2004 the sensor 10 isconnected in parallel with the capacitor C1, and the charge on thecapacitor C1 is transferred at least partially to the capacitor C andgenerally the sensor 10, i.e., the charge of the capacitor C1 is sharedwith the sensor 10.

Next, the control unit 20 opens the second pin 204 in a step 2006, i.e.,both pins 202 and 204 are floating. For example, the processing unit 230may drive both the pin 202 and the pin 204 with the logic level “Z”.Accordingly, due to the fact that the LC sensor 10 has been chargedduring the step 2006, the LC resonant circuit 10 starts to oscillate inthe step 2008, as described above. Finally, the procedure terminates ata step 2010.

The driving scheme may also include an optional step 2008, in which theoscillation is stopped. For example, this might be useful if multipleconsecutive measurements have to be performed. As shown in FIG. 8, thisstep 2008 may be performed at the end of a measurement (after step 2006)or could be performed at the beginning of a new measurement, e.g. beforestep 2002. For example, during the step 2008, both pads 202 and 204 maybe connected to ground, e.g., the processing unit 230 may drive both thepin 202 and the pin 204 with the logic level “0”, in order to dischargethe capacitors C1 and C.

The above description is applicable to a single sensor 10. However thesystem may also be extended to multiple sensors, e.g., by using a singlepad 202 and a respective sensing pad 204 for each LC sensor. Generallyspeaking, the amount of charge transferred during the step 2004 dependson the excitation time T_(excit), in which the switch 222 remains closedwhile the switch 220 is opened, i.e., the duration of the step 2004.

Basically, if the time T_(excit) is sufficiently short, the inductor Lof the sensor may be assumed open and at the end of the step 2004 thetotal charge originally stored in the capacitor C1 will be redistributedbetween the two capacitors C1 and C, and the voltage at the capacitorsC1 and C will be given by the capacitor divider formula. For example, incase the two capacitors C1 and C have the same capacitance and assuminginstantaneous charge transfer, the voltage on the capacitor C1 and thecapacitor C would reach half of the voltage supply signal VDD.

However, it will be appreciated that the charge transfer is indeed not“instantaneous”, e.g., due to resistive loads between the capacitor Cand C1, and the inductor L cannot be assumed always open during the timeT_(excit). That is the capacitor C1 will also discharge through theinductor L. As a consequence, the final voltages at the capacitor C1 andthe capacitor C depend on the time T_(excit), i.e., the voltages reachedby the capacitor C1 and the sensor capacitor C (at the end of the step2004 and the beginning of step 2006) depend on the excitation timeT_(excit).

Accordingly, the Capacitive Dynamic Charge Sharing (CDCS) techniqueshown in FIGS. 6 and 7 is based substantially on a capacitive dividerprinciple (exploiting existing components) applied during a transitoryperiod. Specifically, in the embodiment considered, the capacitor C1 ispre-charged to VDD, and the charge is transferred partially to thesensor 10 as a function of the duration T_(excit) of the step 2004,i.e., while pin 202 is floating and pin 204 is connected to ground.However, as described above, the voltage at the capacitor C1 during thestep 2006, in which the LC sensor is oscillating, constitutes the middlepoint voltage V_(MID) of the oscillation. Accordingly, by controllingthe duration Texcit, it is possible to regulate the voltage V_(MID),i.e., the voltage at the capacitor C1 at the end of the step 2004 or thebeginning of step 2006.

Self-Tuning Reference

The Self-Tuning Reference (STR) technique, when used in conjunction withthe previously described Capacitive Dynamic Charge Sharing (CDCS)technique, permits the use of a simple comparator with fixed (e.g.,internal) reference value V_(Ref) to analyze the oscillation during thestep 2006. Accordingly, no digital-to-analog converter (e.g., block 208in FIG. 3a ) or controllable voltage reference (e.g., block 212 in FIG.4) is required.

For example, as shown in FIG. 9, a comparator 250 may be connected tothe pin 204 and compare the voltage at the pin 204 with a fixedreference value V_(Ref). The result of the comparison CMP may then bemade available to the processing unit 230, e.g., the digital processingcore of a microcontroller, which may be configured for analyzing thesequence of pulses in the signal CMP.

For example, in some embodiments, a comparator with hysteresis, such asa Schmitt Trigger, with fixed thresholds may be used to analyze theoscillation. For example, such Schmitt Triggers with fixed thresholdsare often used in the sensing circuitry of the input pads ofmicrocontrollers or other digital integrated circuits. Accordingly, noadditional components may be required and the conventional sensingcircuitry of an input pin of microcontroller may be used.

By way of example, as shown in FIG. 10, the conventional sensingcircuitry 260 of an input pad, e.g., of a microcontroller, may be usedto implement the comparator 250. Accordingly, the result of thecomparison may be directly available to the processing core 230 bymerely “reading” the value associated with the input pad 204.

In the prior-art approach described with respect to FIG. 4, thepossibility of tuning the internal reference voltage V_(Ref) via thesource 212 usually permits setting a reference value V_(Ref) whichensures that enough digital pulses are generated at the output CMP ofthe comparator, but not too many pulses to avoid a waste of time andpower (see also FIGS. 5a and 5b ). Conversely, in some embodiments, theabove-mentioned Capacitive Dynamic Charge Sharing technique is used toselectively vary the middle point voltage V_(MID) of the oscillationinstead of the threshold voltage of the comparator 250. Accordingly, therole of V_(MID) and V_(Ref) are swapped, i.e., by moving the VoltageV_(MID), the number of digital pulses may be varied in a substantiallysimilar way as moving the voltage V_(Ref).

By way of example, FIG. 11a shows a typical oscillation of an LC sensorwith a middle point V_(MID) (which usually corresponds to 0.5 VDD) andthe reference voltage V_(Ref), which in the example is set to V_(MID).Conversely, FIG. 11b shows an example in which the middle point voltageV_(MID) has been raised to change the number of digital pulses insteadof moving the voltage V_(Ref).

Similarly, FIG. 11c shows the waveform of FIG. 11a , in which a SchmittTrigger has been used, e.g., with a lower threshold TL of 0.4 VDD and anupper threshold TH of 0.6 VDD. Finally, FIG. 11d shows the waveform ofFIG. 11b with raised middle point voltage V_(MID), and where the SchmittTrigger of FIG. 11c has been used.

As shown in the above FIGS. 11a to 11d , the number of pulses at theoutput of the comparator 210 varies for the same waveform as a functionof the middle point voltage V_(MID). However, as mentioned above, themiddle point voltage V_(MID) varies as a function of the excitation timeT_(excit) during the charge transfer phase 2004. Thus, by controllingthe time T_(excit), the comparison result may be tuned.

FIG. 12 shows in this context an embodiment of an integrated circuit 20,such as a microcontroller, which may be used to perform the above-notedoperations. More specifically, pad 204 is an input and output pad withthe associated three state output drive circuitry 242 and input sensingcircuitry 260, such as a Schmitt Trigger. Pad 202 is at least an outputpad with the associated three state output drive circuitry 240.

Accordingly, by driving the pads 202 and 204 via the driver circuitry240 and 242 as described above, in particular with respect to FIG. 8,the oscillation of the LC sensor 10 may be stimulated and the middlepoint voltage V_(MID) may be set. More specifically, the driving of thepads 202 and 204 may be performed via the digital processing core 230.

Once the oscillation has been started, the output from the sensingcircuitry 260 is fed to the processing core 230 for further analysis todetermine characteristics of the oscillation. For example, as shown withrespect to FIGS. 5a and 5b , the output CMP is indicative for thedamping factor of the oscillation, which in turn is indicative for thepresence of a metallic object near the sensor 10. Generally speaking,the digital processing unit 230 may be a dedicated hardware module, ageneral-purpose processor programmed via software instructions or acombination of both.

Thus, counting of the pulses in the signal CMP may also be performed viathe digital processing core. However, the oscillation may have a highfrequency, in which case counting via software instructions may not befeasible. Accordingly, such this case the control unit 20 may include ahardware-implemented counter 270, which already is often included inconventional microcontrollers, and the output of the sensing circuitry260 may be fed to the counter 270. Thus, the counter 270 may count thenumber of pulses in the signal CMP independently from the processingunit 230 and the processing unit 230 may only read the final result,i.e., the signal at the output of the counter 270, and eventually resetthe counter 270 when a new measurement is started.

Moreover, the counter 270 may also be extended to provide a dedicatemeasurement and processing unit which directly elaborates the signal CMPto extract the information required. For example, the measurement andprocessing unit 270 may directly detect the sensor's state, such as overmetal, over plastic, etc.

The module 270 may also generate at least on programmable interrupt onspecific conditions. For example, such a measurement and processing unitmay also be connected to a plurality of sensing pads 204 to elaboratethe signal from a plurality of sensors, e.g., to perform a speed orrotation measurement.

As shown with respect to FIGS. 11a to 11d , the number of pulses at theoutput of the comparator 210 varies for the same waveform as a functionof the middle point voltage V_(MID). The middle point voltage V_(MID) inturn varies as a function of the excitation time T_(excit) during thecharge transfer phase 2004.

In some embodiments, the Self-Tuning Reference (STR) technique looksdirectly at the number of digital pulses generated at the output of thecomparator, e.g. the Schmitt Trigger 260 of FIG. 10 to automaticallytune the excitation time T_(excit) to be used in the CDCS techniquedescribed in the foregoing. In this way, a desired number of digitalpulses may be achieved, which usually corresponds to a given referencecondition (e.g., with metal). For example, the reference conditionusually corresponds to the situation with the greatest damping factor,which corresponds to the oscillation with the lowest expectable numberof pulses in the output CMP of the comparator 250/260. By way ofexample, in some embodiments a closed-loop regulation is used to set thetime T_(excit) to ensure that the number of pulse for a given referencecondition, e.g., the condition with the greatest damping factor,corresponds to the target number of pulses K. In this case, whenmeasuring the reference condition the number of pulses at the output ofthe comparator will include K counts, and the number of pulses willincrease in condition with a lower damping factor.

For example, considering an exemplary case where the resistance R in thesensor 10 (which primarily models the damping behavior) may be between 3and 45 Ohms, and the minimum number of count K should be 4, thecalibration would be performed for the condition with R=45 Ohm. By wayof example, for a typical LC sensor, the final results may then be:

4 pulses for R=45 Ohm;

5 pulses for R=37 Ohm; and

9 pulses for R=3 Ohm.

Moreover, the described calibration mechanism renders the system robustagainst variations of parameters which influence the oscillation. Forexample, FIG. 13 shows a table including the number of pulses in thesignal CMP for different supply voltages VDD∈{3.3V, 2.V, 2.5V, 2.1V},temperatures T∈{−30° C., 25° C., 125° C.}}, and resistances R∈{3 Ohm, 37Ohm, 45 Ohm}. As shown in FIG. 13, this approach is very robust againstvoltage variations, while the resolution may be affected by lowtemperatures.

In some embodiments, instead of performing the calibration only once,the Self-Tuning Reference technique may be run continuously and regulatethe voltage V_(MID), ensuring that the number of pulses in the signalCMP for a measurement is never smaller than K. For example, this may beuseful for rotation sensors where a disc with a metal profile is rotatedin front of at least one LC sensor 10, because in this case it may bedifficult to establish a priori the correct reference condition. Thus,generally speaking, the Self-Tuning Reference technique may be performedby the digital processing unit 230 or also directly by the measurementand processing unit 270.

The STR technique may also be used to identify the direction to takewhen modifying the time T_(excit) and/or cope with deadlocks, which mayoccur when the time T_(excit) is out of the valid range. For example, insome embodiments, the following parameters may be used:

-   -   NP—number of pulses for the current measurement cycle;    -   PNP—number of pulses for the previous measurement cycle;    -   DIR—direction;    -   PDIR—previous direction;    -   K—target minimum number of pulses for a measurement;    -   T_(excit)—excitation time, e.g. in clock periods during which        the capacitor C₁ transfers charge to the sensor 10; and    -   TO—timeout, e.g., in measurement cycles.

In some embodiments, when the number of measured pulses NP is less thanthe target K and less than pulses in the previous cycle PNP, a directionchange may be forced, because it may be assumed that the time T_(excit)should be corrected in the opposite direction. In some embodiments, acounter C is used to check whether the timeout condition occurs. Forexample, such a counter C may be incremented each time the number ofmeasure pulses NP is less than K but equal to the previous one NPN.Accordingly, if this condition is true for TO measurement cycles, theparameter T_(excit) is out of range, because there is no moresensitivity to a variation of T_(excit). For example, in this case, thetime T_(excit) may be reset to its original value and the direction ischanged.

By way of example, FIG. 14 shows a flow chart of a method which may beused to automatically determine the time T_(excit). After a start step3000, the procedure starts and the parameters are initialized in a step3002. For example, in this step 3002 the counter C may be reset (e.g.,set to zero), the parameter PNP is set to zero, and the time T_(excit)is set to an initial default value (e.g., zero).

The procedure continues at a step 3004 where a measurement is performed.If the calibration procedure is always switched on, the procedure mayalso merely monitor whether a measurement has been performed.

In a verification step 3006, the procedure verifies whether the measurednumber of pulses NP is less than the target value K. If the measurednumber of pulses NP is equal or greater than the target K (output “N” ofthe conditional step 3006), no correction is required and the procedurecontinues at a step 3008 where the timeout counter C is reset (e.g., setto zero), and the procedure returns to step 3004.

On the contrary, where the measured number of pulses NP is less than thetarget value K (output “Y” of the verification step 3006), somecorrection may be required and the procedure continues at a step 3010.Specifically, in the verification step 3010, the procedure verifieswhether the measured number of pulses NP is less than the previousnumber of pulses PNP.

When the measured number of pulses NP is less than the previous numberof pulses PNP (output “Y” of the verification step 3010), the directionDIR for the correction of the time T_(excit) is inverted at a step 3012.For example, if the previous direction PDIR indicates that the timeT_(excit) should be decreased, the new direction DIR indicates now thatthe time T_(excit) should be incremented. On the contrary, if theprevious direction PDIR indicates that the time T_(excit) should beincremented, the new direction DIR indicates now that the time T_(excit)should be decremented.

Moreover, in this case the counter C is reset at a step 3014, and thetime T_(excit) is updated at a step 3016, e.g., by decrementing orincrementing the value of T_(excit) based on the updated parameter DIR.For example, in an example embodiment the parameter T_(excit) is variedmerely by one clock cycle, i.e., T_(excit)=T_(excit)±1. However, thevariation may depend on the velocity of the control unit, e.g., thefrequency of the clock signal.

Finally, the parameters of the previous cycle are update at a step 3018,e.g., by assigning the value of the direction DIR to the previousdirection PDIR and the value of the number of pulses NP to the previousnumber of pulses PNP. On the contrary, if the measured number of pulsesNP is equal or greater than the previous number of pulses PNP (output“N” of the verification step 3010), the direction DIR for the correctionof the time T_(excit) is usually correct.

However, in this case it may be verified whether a timeout condition isreached. For example, in the embodiment considered, the procedureverifies whether the measured number of pulses NP is equal to theprevious number of pulses PNP in a step 3020.

More specifically, if the number of measured pulses NP is not equal tothe previous number of pulses PNP (output “N” of the verification step3020) and taking into account that is has previously been verified thatthe measured number of pulses NP is not smaller than the previous numberof pulses PNP (see step 3010), the measured number of pulses NP isgreater than the previous number of pulses PNP. Accordingly, in thiscase the correction is going in the correct direction and the timeoutcounter C may be reset and the time T_(excit) may be updated, i.e.,incremented or decremented based on the current direction DIR. Forexample, in the present embodiment, the procedure simply proceeds at thestep 3014 for this reason.

Conversely, in case the where number of measured pulses NP is equal tothe previous number of pulses PNP (output “Y” of the verification step3020), a timeout condition may be present. This is because the lastvariation of the time T_(excit) did not influence the measured number ofpulses.

Accordingly, in some embodiments, the procedure continues to incrementor decrement the time T_(excit) until a variation of the number of pulseoccurs or a timeout is reached. For example, in the present embodiment,the procedure continues for this reason at a verification step 3022, inwhich the procedure verifies whether the counter C has reached thetimeout value TO.

When the counter C has not reached the timeout value TO (output “N” ofthe verification step 3022), a single variation of the time T_(excit)might have been insufficient, and the counter C is incremented in a step3024. Moreover, in this case the procedure continues to vary the timeT_(excit) in the current direction, i.e., incremented or decrementedT_(excit) based on the current direction DIR. For example, in thepresent embodiment, the procedure proceeds at the step 3016 for thisreason.

Conversely, if the counter C has reached the timeout value TO (output“Y” of the verification step 3022), a timeout condition occurred, i.e.,variations of the time T_(excit) do not influence anymore the number ofpulses. In this case, a possible approach may be to see if variations inthe opposite direction are suitable to reach the required number ofpulses K. For example, in an example embodiment, the direction isinverted and the time T_(excit) is set to the previous value before atimeout condition was reached.

In the present embodiment, the direction DIR for the correction of thetime T_(excit) may be inverted at a step 3026. For example, if theprevious direction PDIR indicates that the time T_(excit) should bedecreased, the new direction DIR indicates now that the time T_(excit)should be incremented. On the contrary, if the previous direction PDIRindicates that the time T_(excit) should be incremented, the newdirection DIR indicates now that the time T_(excit) should bedecremented.

Moreover, in this case the counter C is reset at a step 3028, and thetime T_(excit) is set to the previous value T_(excit) at a step 3030.For example, if the new direction DIR indicates that the time T_(excit)should be incremented, the timeout value TO may be added to the timeT_(excit), i.e. T_(excit)=T_(excit) TO, thus turning back to the valueof T_(excit) prior to the timeout loop. On the contrary, if the newdirection DIR indicates that the time T_(excit) should be decremented,the timeout value TO may be subtracted from the time T_(excit), i.e.,T_(excit)=T_(excit)−TO.

Finally, the procedure may continue in this case at step 3018 to updatethe parameters of the previous cycle. For example, the convergence ofthe above described procedure has been verified with a conventionalmicrocontroller for K=4 and TO=4.

In addition to the above-described methods for setting the minimumnumber of pulses K, a different approach may also be used to set thetime T_(excit). More specifically, in some embodiments, the voltageV_(MID) is determined via a Schmitt Trigger connected to pad 202, e.g.,a respective input circuitry 262 of the pad 202 (see, e.g., FIG. 12)similar to the one described for the pad 204.

In an example embodiment, by driving the pads 202 and 204 and bymonitoring the voltage at the pad 202 via a Schmitt trigger, it ispossible to regulate the voltage V_(MID). More specifically, FIG. 15shows a calibration procedure and FIG. 16 shows a respective waveform ofthe voltage at pad 202, and thus the voltage V_(MID) at the capacitorC1, for a given period of time t.

After a start step 4000, the control unit 20 sets in a step 4002 the pad202 to the voltage VDD and the pad 204 to a high impedance state. Forexample, the processing unit 230 may drive the pin 202 with the logiclevel “1” and the pin 204 with the logic level “Z”.

Accordingly, this condition corresponds to step 2002 described abovewith respect to FIG. 8. That is, only the capacitor C1 is connectedbetween the supply voltage VDD and ground GND and the capacitor C1 ischarged.

Once the voltage V202 at the pad 202 is stable (e.g., after a givenperiod of time), the control unit 20 connects in a step 4004 (at timet1) the pad 204 to ground GND and sets the pad 202 to a high impedancestate. For example, the processing unit 230 may drive the pin 202 withthe logic level “Z” and the pin 204 with the logic level “0”.Accordingly, this condition corresponds to step 2004 described withrespect to FIG. 8, in which the sensor 10 is connected in parallel withthe capacitor C1 and the charge on the capacitor C1 is transferred atleast partially to the sensor 10. Accordingly, in this stage the voltageat pad 202 decreases as shown in FIG. 16.

In the present embodiment, the processing unit 230 monitors the logiclevel CMP202 at the output of the Schmitt Trigger 262 associated withthe pad 202. In fact, while the voltage V202 remains above the lowerthreshold TL of the Schmitt Trigger, the signal CMP202 will be high,i.e., the logic level “1”.

At the moment t2 when the signal CMP202 goes low, i.e., the logic level“0”, the voltage V202 has reached the lower threshold TL. Immediatelyafter having detected that the signal CMP202 has gone low, i.e., at theinstant t2, the control unit 20 sets at step 4006 the pad 202 to thevoltage VDD and the pad 204 is connected to Z.

Accordingly, at time t, the capacitor C, stored the following charge:

Q _(t1) =C1·Vdd,

while the capacitor C₁ stored only the following charge at the time t2:

Q _(t2) =C1·TL,

i.e., the following charge has been transferred to the LC sensor 10:

Q _(LC) =Q _(t1) −Q _(t2)

Accordingly, at this moment the oscillation of the LC sensor 10 has beenstarted and the pin 202 could also be disconnected or placed in a highimpedance state. Conversely, in the embodiment considered, at this stagethe capacitor C1, (i.e., pin 202) is connected again to the supplyvoltage VDD to recharge the capacitor C1, thus increasing the middlepoint voltage V_(MID). By way of example, the processing unit 230 maydrive the pin 202 with the logic level “1” and the pin 204 with thelogic level “Z”.

At the moment t3 when the signal CMP202 goes to high, (i.e., the logiclevel “1”), the voltage V_(MID)/V202 has reached the upper threshold TH.Thus, the time between t2 and t3 is indicative for the time required tocharge the capacitor C1 from TL to TH.

Accordingly, the control unit 20 may detect during the calibration phasein a step 4008 the time elapsed between the instants t2 and t3 andperform during the normal operation a recharging with a recharge timeT_(recharge) determined as a function of the time elapsed, thusregulating the middle point voltage V_(MID) to be used during the normaloperation. For example, the maximum number of pulses in the signal CMPmay be expected by setting the recharge time to:

T _(recharge)=(t ₃ −t ₂)/2,

because in this case, the middle point voltage V_(MID) should correspondmore or less to:

V _(MID)=(TH−TL)/2.

For example, in some embodiments, the method shown in FIG. 8 is modifiedfor this purpose, e.g., by adding an additional step between the step2004 and the step 2006. Specifically, once the comparison signal CMP202indicates that the voltage V202 at the first contact 202 is below thelower threshold TL, the first contact 202 is connected again to thesupply voltage VDD such that said capacitor C1 is recharged through thesupply voltage VDD. More specifically, the recharge durationT_(recharge) of the capacitor C1 is determined as a function of theduration of the above duration t3−t2 of the calibration phase 4006,thereby defining the middle point voltage V_(MID). Finally, theprocedure terminates at a stop step 4010.

In some embodiments, instead of monitoring the recharge time between thethresholds TL and TH (i.e., t2 and t3), the procedure may monitor thedischarge time between the thresholds TH and TL. For example, in anexample embodiment, the procedure may again discharge the capacitor C1after the step 4006, e.g., by using the driving describe with respect tostep 4004. That is, once the voltage V202 has reached the threshold THand the logic level goes to high, the pad 204 is connected to ground GNDand the pad 202 is set to a high impedance state. Thus, by monitoringthe time when the lower threshold TL is reached, i.e., when the logiclevel of CMP202 goes to low, it is possible to determine the dischargebehavior and set the discharge time T_(discharge) accordingly.

Generally speaking, this calibration procedure may also be performedperiodically. Moreover, in some embodiments, the previously-describedclosed loop calibration methods (e.g., the method for setting the timeT_(excit) described with respect to FIG. 14), may also be used toregulate the times T_(recharge) or T_(discharge).

Accordingly, as described above, the Self-tuning Reference techniquetakes advantage of moving the external reference voltage V_(MID) toavoid a variable internal reference signal. While the embodiments havebeen described in combination with the CDCS technique, generallyspeaking, this approach may be applied also to prior art approaches, inwhich the middle point voltage V_(MID) is imposed via a voltage signal(see, e.g., FIG. 3a ). Therefore, the Self-Tuning Reference (STR)technique automatically tunes the time T_(excit) or directly the middlepoint voltage V_(MID) to meet a target number of pulses regardless ofthe working parameters (and in general PVT variations).

The details of construction and the embodiments may vary with respect towhat has been described and illustrated herein purely by way of example,without departing from the scope of the present disclosure, as definedby the ensuing claims.

What is claimed is:
 1. A system, comprising: an LC sensor comprising aninductor and a first capacitor coupled in parallel to the inductor; acontroller comprising a first contact and a second contact, wherein afirst terminal of the first capacitor is coupled to form a node with thefirst contact of the controller, and wherein a second terminal of thefirst capacitor is coupled to form a node with the second contact of thecontroller; and a second capacitor coupled between the first contact ofthe controller and a reference voltage, wherein the controller isconfigured to: during a first phase, connect the first contact of thecontroller to a supply voltage and place the second contact of thecontroller in a high impedance state so that the second capacitor ischarged through the supply voltage; during a second phase, place thefirst contact of the controller in the high impedance state and connectthe second contact to the reference voltage so that the second capacitortransfers a charge to the first capacitor, wherein a residual chargeremains in the second capacitor at an end of the second phase; during athird phase, place the first contact of the controller and the secondcontact of the controller in the high impedance state so that the LCsensor oscillates; and monitor an oscillation at the second contact ofthe controller during the third phase using a comparator to vary aduration of the second phase in order to regulate the residual charge inthe second capacitor at a beginning of the third phase.
 2. The system ofclaim 1, wherein the comparator comprises a comparator with hysteresis.3. The system of claim 2, wherein the comparator with hysteresiscomprises a Schmitt Trigger.
 4. The system of claim 1, wherein thecontroller is configured to monitor the oscillation at the secondcontact of the controller during the third phase using the comparator bycomparing a voltage at the second contact of the controller with a fixedreference value to generate a comparison signal.
 5. The system of claim4, wherein the controller comprises a processing circuit configured toreceive the comparison signal.
 6. The system of claim 4, wherein thecontroller is configured to monitor the oscillation at the secondcontact of the controller during the third phase by counting a number ofpulses in the comparison signal.
 7. A system, comprising: an oscillatorcomprising a first capacitor; a controller comprising a first contactand a second contact, wherein a first terminal of the first capacitor iscoupled to form a node with the first contact of the controller, andwherein a second terminal of the first capacitor is coupled to form anode with the second contact of the controller; and a second capacitorcomprising a first terminal and a second terminal, wherein the firstterminal of the second capacitor is coupled to form a node with thefirst contact of the controller, and wherein the second terminal of thesecond capacitor is coupled to receive a reference voltage, wherein thecontroller is configured to: during a first time period, connect thefirst contact of the controller to a supply voltage and place the secondcontact of the controller in a floating state so that the secondcapacitor is charged through the supply voltage; during a second timeperiod, place the first contact of the controller in the floating stateand connect the second contact of the controller to the referencevoltage so that the second capacitor transfers a charge to the firstcapacitor, wherein a residual charge remains in the second capacitor atan end of the second time period; during a third time period, place thefirst contact of the controller and the second contact of the controllerin the floating state so that the oscillator generates a voltage at thesecond contact of the controller that oscillates about a midpointvoltage; and monitor an oscillation of the voltage at the second contactof the controller during the third time period by comparing the voltageat the second contact of the controller against an upper threshold and alower threshold to vary a duration of the second time period in order toregulate the residual charge in the second capacitor at a beginning ofthe third time period without varying the upper threshold or the lowerthreshold.
 8. The system of claim 7, wherein the residual chargecomprises a non-zero residual charge.
 9. The system of claim 7, whereinthe midpoint voltage is regulated by regulating the residual charge inthe second capacitor at the beginning of the third time period.
 10. Thesystem of claim 7, wherein the controller is configured to monitor theoscillation of the voltage at the second contact of the controllerduring the third time period by generating a comparison signal, whereinthe comparison signal is set to a first level when the voltage at thesecond contact of the controller is above the upper threshold, and to asecond level when the voltage at the second contact of the controller isbelow the lower threshold.
 11. The system of claim 10, wherein thecontroller is further configured to performing a calibration by: duringa first calibration phase, connecting the first contact of thecontroller to the supply voltage and placing the second contact of thecontroller in the floating state so that the second capacitor is chargedthrough the supply voltage; during a second calibration phase, placingthe first contact of the controller in the floating state and connectingthe second contact of the controller to the reference voltage so thatthe second capacitor transfers charge to the first capacitor; during athird calibration phase, once the comparison signal indicates that thevoltage at the second contact of the controller is below the lowerthreshold, connecting the first contact of the controller to the supplyvoltage so that the second capacitor is charged through the supplyvoltage; and during a fourth calibration phase, once the comparisonsignal indicates that the voltage at the second contact of thecontroller is above the upper threshold, determining a duration of thethird calibration phase.
 12. The system of claim 7, wherein thecomparator comprises a Schmitt Trigger.
 13. A method, comprising: duringa first time period, connecting a first contact of a controller to asupply voltage and placing a second contact of the controller in afloating state so that a capacitor is charged through the supplyvoltage, wherein a first terminal of the capacitor is coupled to form anode with the first contact of the controller, wherein a second terminalof the capacitor is coupled to receive a reference voltage; during asecond time period, placing the first contact of the controller in thefloating state and connecting the second contact of the controller tothe reference voltage so that the capacitor transfers a charge to afurther capacitor coupled between the first contact and the secondcontact of the controller, wherein a residual charge remains in thecapacitor at an end of the second time period; during a third timeperiod, placing the first contact of the controller and the secondcontact of the controller in the floating state so that a voltage isgenerated at the second contact of the controller that oscillates abouta midpoint voltage; and monitoring an oscillation of the voltage at thesecond contact of the controller during the third time period bycomparing the voltage at the second contact of the controller against anupper threshold and a lower threshold to vary a duration of the secondtime period in order to regulate the residual charge in the capacitor ata beginning of the third time period without varying the upper thresholdor the lower threshold.
 14. The method of claim 13, wherein monitoringthe oscillation of the voltage at the second contact of the controllerduring the third time period comprises: generating a comparison signal,wherein the comparison signal is set to a first level when the voltageat the second contact of the controller is above the upper threshold,and to a second level when the voltage at the second contact of thecontroller is below the lower threshold.
 15. The method of claim 14,further comprising: during a first calibration phase, connecting thefirst contact of the controller to the supply voltage and placing thesecond contact of the controller in the floating state so that thesecond capacitor is charged through the supply voltage; during a secondcalibration phase, placing the first contact of the controller in thefloating state and connecting the second contact of the controller tothe reference voltage so that the second capacitor transfers charge tothe first capacitor; during a third calibration phase, once thecomparison signal indicates that the voltage at the second contact ofthe controller is below the lower threshold, connecting the firstcontact of the controller to the supply voltage so that the secondcapacitor is charged through the supply voltage; and during a fourthcalibration phase, once the comparison signal indicates that the voltageat the second contact of the controller is above the upper threshold,determining a duration of the third calibration phase.
 16. The method ofclaim 14, wherein monitoring the oscillation of the voltage at thesecond contact of the controller during the third time period comprisescounting a number of pulses in the comparison signal.
 17. The method ofclaim 13, wherein the residual charge comprises a non-zero residualcharge.
 18. The method of claim 13, wherein the midpoint voltage isregulated by regulating the residual charge in the second capacitor atthe beginning of the third time period.
 19. The method of claim 13,wherein the comparator comprises a comparator with hysteresis.